Skip to content

fix(scheme): register Istio and Gateway API source types#301

Merged
golgoth31 merged 1 commit into
mainfrom
fix/register-source-schemes
Jun 18, 2026
Merged

fix(scheme): register Istio and Gateway API source types#301
golgoth31 merged 1 commit into
mainfrom
fix/register-source-schemes

Conversation

@golgoth31

Copy link
Copy Markdown
Owner

Summary

On dev the SourceReconciler looped on:

source.cycle  list failed; preserving previous state
err: no kind is registered for the type v1.GatewayList in scheme "pkg/runtime/scheme.go:111"  kind=istio-gateway

The source resolvers list external API types (Istio Gateway/VirtualService, Gateway API HTTP/GRPC/TCP/TLS/UDPRoute), but the manager scheme only registered client-go, external-dns and sreportal types. As soon as a DNS CR enabled one of those sources (here istio-gateway, from the legacy config), the per-DNS source cycle failed client-side.

Fix

Register the missing schemes in cmd/main.go init():

  • istio.io/client-go/pkg/apis/networking/v1 (Gateway, VirtualService) — AddToScheme
  • sigs.k8s.io/gateway-api/apis/v1 (HTTPRoute, GRPCRoute) — Install
  • sigs.k8s.io/gateway-api/apis/v1alpha2 (TCP/TLS/UDPRoute) — Install

Crossplane records use unstructured (no registration needed); service/ingress/dnsendpoint were already covered by client-go / external-dns. If a source's CRD is absent from the cluster, the source cycle already treats the List as benign.

Adds cmd/scheme_test.go asserting the scheme recognizes every external resolver's list type, so a future source addition that forgets registration fails the test.

Notes

  • No RBAC regen needed: the +kubebuilder:rbac markers for networking.istio.io and gateway.networking.k8s.io already exist on the resolvers and in config/rbac/role.yaml (make manifests → no diff).

Test plan

  • cmd/scheme_test.go passes (scheme recognizes all 7 external list types)
  • go vet ./cmd/..., golangci-lint clean (Install used; AddToScheme-deprecation avoided)
  • Review panel (exec-trace / code) — RAS

🤖 Generated with Claude Code

The SourceReconciler resolvers list external API types (Istio Gateway /
VirtualService, Gateway API HTTP/GRPC/TCP/TLS/UDP routes), but the manager
scheme only registered client-go, external-dns and sreportal types. When a
DNS CR enabled e.g. the istio-gateway source, the per-DNS source cycle
failed client-side:

  source.cycle  list failed; preserving previous state
  err: no kind is registered for the type v1.GatewayList in scheme ...

Register the Istio networking/v1 and Gateway API v1 / v1alpha2 schemes in
init(). Crossplane records use unstructured and need no registration; if a
source's CRD is absent from the cluster the cycle already treats the List
as benign.

Adds a cmd test asserting the scheme recognizes every external resolver's
list type, guarding against future source additions missing registration.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
@golgoth31 golgoth31 merged commit 5ea5c5f into main Jun 18, 2026
2 checks passed
@golgoth31 golgoth31 deleted the fix/register-source-schemes branch June 18, 2026 18:46
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant